package com.kc.web.controller.business;

import com.kc.business.domain.BizTourguideEnterForm;
import com.kc.business.service.IBizTourguideEnterService;
import com.kc.common.annotation.Log;
import com.kc.common.annotation.RepeatSubmit;
import com.kc.common.core.controller.BaseController;
import com.kc.common.core.domain.AjaxResult;
import com.kc.common.core.page.TableDataInfo;
import com.kc.common.enums.BusinessType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * TODO
 *
 * @author zhangshuo
 * @version 1.0
 * @date 2020/9/25
 */
@RestController
@RequestMapping("/business/tourguideEnter")
public class BizTourguideEnterController extends BaseController {

    @Resource
    private IBizTourguideEnterService tourguideEnterService;

    /**
     * 获取导游入驻列表
     */
    @PreAuthorize("@ss.hasPermi('business:tourguideEnter:list')")
    @GetMapping("/list")
    public TableDataInfo list(BizTourguideEnterForm tourguideEnterForm) {
        startPage();
        List<BizTourguideEnterForm> list = tourguideEnterService.getList(tourguideEnterForm);
        return getDataTable(list);
    }

    /**
     * 修改导游入驻
     */
    @PreAuthorize("@ss.hasPermi('business:tourguideEnter:edit')")
    @Log(title = "导游入驻管理", businessType = BusinessType.UPDATE)
    @PutMapping
    @RepeatSubmit
    public AjaxResult edit(@RequestBody BizTourguideEnterForm tourguideEnterForm) {
        return toAjax(tourguideEnterService.edit(tourguideEnterForm));
    }
}
